const getServiceHost = (clusterServiceName, defaultValue) => {
  if (process.env.CLUSTER_MODE) {
    return clusterServiceName;
  } else {
    return defaultValue;
  }
};

let config = {
  env: process.env.NODE_ENV || 'development',
  systemBearerToken: 'full',
  serverPort: process.env.SERVER_PORT || 4000,
  zookeeper: {
    url: `${getServiceHost('zookeeper', 'localhost')}:2181`
  },
  kafka: {
    topic: 'topicFull',
    groupId: 'groupFull'
  },
  wechat: {
    pub: {
      appId: 'wxc5a5302305253274',
      mchId: '1430950102',
      appSecret: '4f20e14ac47145d1fb19a0377c6edf9d',
      partnerKey: 'bxnNi7CkKzfe6IZnQMi3oncwyk17ZYrk'
    },
    app: {
      appId: 'wxf628c1e003c1018c',
      mchId: '1487722112',
      appSecret: 'bc79843956c554a9212b98b37bea2104',
      partnerKey: 'tF1seFbUZbk9gPxerfIWpdxdp7pWZl3Q'
    }
  },
  sms: {
    url: 'http://sdk999in.eucp.b2m.cn:8080/sdkproxy/sendsms.action',
    key: '9SDK-EMY-0999-JERQO',
    password: 'D5D974DD17EB375A139F317B9F6E0C3E',
    appCode: 'f70c761e6f914d08823f10c4139018b9'
  },
  huanxin: {
    url: 'https://a1.easemob.com/1186170113115624/bfftrip',
    clientId: 'YXA6PpaOkNmuEea2Xt_N094QPA',
    clientSecret: 'YXA60fMeqcHRvIoGv-Y6ahESyScwhh4',
    adminHxUserName: 'b7706d10ef4111e69fadfb1e8629646d'
  }
};

console.log(config);

config.__DEV__ = config.env === 'development';

module.exports = config;
